package com.hongyun.tms.common.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hongyun.tms.common.annotation.Dict;
import com.hongyun.tms.common.annotation.excel.ExcelInfo;
import com.hongyun.tms.infra.excel.converter.LocalDateTimeOrDateConverter;
import com.hongyun.tms.infra.excel.converter.dict.DictConverter;
import com.hongyun.tms.infra.excel.converter.enums.TugStatusEnumConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 拖轮信息表
 *
 * @author yuheng
 * @since 1.0.0 2024-06-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ExcelInfo(fileName = "拖轮信息导出")
public class TmsMTugVO {

    @ExcelIgnore
    private Long id;

    @ApiModelProperty(value = "拖轮名称")
    @ExcelProperty(value = "拖轮名称", index = 0)
    private String tugName;

    @ApiModelProperty(value = "拖轮编号")
    @ExcelProperty(value = "拖轮编号", index = 1)
    private String tugNo;

    @ApiModelProperty(value = "拖轮状态，0适航1不适航2停修")
    @ExcelProperty(value = "拖轮状态", index = 2, converter = TugStatusEnumConverter.class)
//    @ExcelProperty(value = "拖轮状态(适航/不适航/停修)", index = 2)
    private Integer staus;

    @ApiModelProperty(value = "拖轮类型")
    @Dict(code = "TUG_TYPE", fieldName = "tugTypeName")
    @ExcelProperty(value = "拖轮类型", converter = DictConverter.class, index = 3)
    private String tugTypeCode;

    @ApiModelProperty(value = "注册港")
    @ExcelProperty(value = "注册港", index = 4)
    private String registryPort;

    @ApiModelProperty(value = "经营人")
    @ExcelProperty(value = "经营人", index = 5)
    private String operator;

    @ApiModelProperty(value = "所有人")
    @ExcelProperty(value = "所有人", index = 6)
    private String owner;

    @ApiModelProperty(value = "建造日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ExcelProperty(value = "建造日期(格式：年-月-日)", converter = LocalDateTimeOrDateConverter.class, index = 7)
    private LocalDate buildDate;

    @ApiModelProperty(value = "建造厂家")
    @ExcelProperty(value = "建造厂家", index = 8)
    private String buildFactory;

    @ApiModelProperty(value = "IMO")
    @ExcelProperty(value = "IMO", index = 9)
    private String imo;

    @ApiModelProperty(value = "呼号")
    @ExcelProperty(value = "呼号", index = 10)
    private String callNo;

    @ApiModelProperty(value = "船舶识别号")
    @ExcelProperty(value = "船舶识别号", index = 11)
    private String idNo;

    @ApiModelProperty(value = "船舶登记号")
    @ExcelProperty(value = "船舶登记号", index = 12)
    private String regNo;

    @ApiModelProperty(value = "总长")
    @ExcelProperty(value = "总长", index = 13)
    private BigDecimal tugLength;

    @ApiModelProperty(value = "型宽")
    @ExcelProperty(value = "型宽", index = 14)
    private BigDecimal tugWidth;

    @ApiModelProperty(value = "型深")
    @ExcelProperty(value = "型深", index = 15)
    private BigDecimal tugDepth;

    @ApiModelProperty(value = "主机功率")
    @ExcelProperty(value = "主机功率", index = 16)
    private String power;

    @ApiModelProperty(value = "马力")
    @ExcelProperty(value = "马力", index = 17)
    private String horsepower;

    @ApiModelProperty(value = "总吨")
    @ExcelProperty(value = "总吨", index = 18)
    private BigDecimal totalTon;

    @ApiModelProperty(value = "净吨")
    @ExcelProperty(value = "净吨", index = 19)
    private BigDecimal netTon;

    @ApiModelProperty(value = "满载吃水")
    @ExcelProperty(value = "满载吃水", index = 20)
    private BigDecimal draftFull;

    @ApiModelProperty(value = "空载吃水")
    @ExcelProperty(value = "空载吃水", index = 21)
    private BigDecimal draftEmpty;

    @ApiModelProperty(value = "作业港区代码,字典")
    @Dict(code = "PORT_AREA", fieldName = "portAreaName")
//    @ExcelProperty(value = "作业港区", index = 22, converter = DictConverter.class)
    @ExcelIgnore
    private String portAreaCode;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @ExcelProperty(value = "创建时间", index = 23, converter = LocalDateTimeOrDateConverter.class)
    @ExcelIgnore
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelIgnore
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "作业次数")
    @ExcelIgnore
    private BigDecimal workNum;

    @ApiModelProperty(value = "备注")
    @ExcelProperty(value = "备注", index = 22)
    private String remark;
}
